﻿package mortal.game.scene3D.map3D
{
    import Message.Public.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.map3D.sceneInfo.*;
    import mortal.game.utils.*;

    public class MapState extends Object
    {
        public var curSceneInfo:SceneInfo;
        public var isNormalMap:Boolean;
        public var isCopyMap:Boolean;
        public var isCrossMap:Boolean;
        public var isDramaMap:Boolean;
        public var isVIPMap:Boolean;
        public var isBattlefield:Boolean;
        public var isGuildWar:Boolean;
        public var isHoleBoss:Boolean;
        public var isEscortCopy:Boolean;
        public var isPetBreakMap:Boolean;
        public var isDefenseMap:Boolean;
        public var isTowerMap:Boolean;
        public var isArenaCopy:Boolean;
        public var isSunbathMap:Boolean;
        public var isWineMap:Boolean;
        public var isGuildBoss:Boolean;
        public var isTreasureHunt:Boolean;
        public var isGroupTowerMap:Boolean;
        public var isSixBossMap:Boolean;
        public var isAutoArenaMap:Boolean;
        public var isHeroArenaMap:Boolean;
        public var isHeroArenaRestRoomMap:Boolean;
        public var isJLMDCopy:Boolean;
        public var isQuestionCopy:Boolean;

        public function MapState()
        {
            return;
        }// end function

        public function initMapId(param1:int) : void
        {
            var _loc_2:int = 0;
            this.curSceneInfo = SceneConfig.instance.getSceneInfo(param1);
            this.restMap();
            this.isBattlefield = CopyUtil.getBattlefieldMapId() == param1;
            this.isGuildWar = CopyUtil.getGuildWarMapId() == param1;
            this.isEscortCopy = CopyUtil.escortCopyMapId == param1;
            this.isSunbathMap = CopyUtil.sunbathMapMapId == param1;
            this.isWineMap = CopyUtil.WineMapId == param1;
            this.isGuildBoss = CopyUtil.guildBossMapId == param1;
            this.isDefenseMap = CopyUtil.isDefenseCopyMapId(param1);
            this.isPetBreakMap = CopyUtil.isPetBreakCopyMapId(param1);
            this.isTowerMap = CopyUtil.isTowerCopyMapId(param1);
            this.isGroupTowerMap = CopyUtil.isGroupTowerCopyMapId(param1);
            this.isArenaCopy = CopyUtil.isArenaCopyMapId(param1);
            this.isJLMDCopy = CopyUtil.jlmdCopyMapId == param1;
            this.isHoleBoss = CopyUtil.isHoleBossCopyMapId(param1);
            this.isQuestionCopy = CopyUtil.questionCopyMapId == param1;
            this.isTreasureHunt = CopyUtil.TreasureHuntMapId == param1;
            this.isSixBossMap = CopyUtil.SixBossMapId == param1;
            this.isAutoArenaMap = CopyUtil.AutoArenaMapId == param1;
            this.isHeroArenaMap = CopyUtil.isHeroArenaCopyMapId(param1);
            this.isHeroArenaRestRoomMap = CopyUtil.HeroArenaRestRoomMapId == param1;
            if (this.curSceneInfo)
            {
                _loc_2 = this.curSceneInfo.sMapDefine.instanceType.__value;
                this.isCopyMap = this.curSceneInfo.sMapDefine.instanceType.__value >= EMapInstanceType._EMapInstanceTypeCopy;
                switch(this.curSceneInfo.sMapDefine.instanceType.__value)
                {
                    case EMapInstanceType._EMapInstanceTypeNormal:
                    {
                        this.isNormalMap = true;
                        break;
                    }
                    case EMapInstanceType._EMapInstanceTypeCross:
                    case EMapInstanceType._EMapInstanceTypeCrossNormal:
                    {
                        this.isCrossMap = true;
                        break;
                    }
                    case EMapInstanceType._EMapInstanceTypeCrossHoleBoss:
                    {
                        this.isCrossMap = true;
                        this.isHoleBoss = true;
                        break;
                    }
                    case EMapInstanceType._EMapInstanceTypeDrama:
                    {
                        this.isDramaMap = true;
                        break;
                    }
                    case EMapInstanceType._EMapInstanceTypeVIP:
                    {
                        this.isVIPMap = true;
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }
            return;
        }// end function

        public function restMap() : void
        {
            this.isNormalMap = false;
            this.isCopyMap = false;
            this.isCrossMap = false;
            this.isHoleBoss = false;
            this.isDramaMap = false;
            this.isVIPMap = false;
            this.isBattlefield = false;
            this.isEscortCopy = false;
            this.isPetBreakMap = false;
            this.isDefenseMap = false;
            this.isTowerMap = false;
            this.isGroupTowerMap = false;
            this.isQuestionCopy = false;
            this.isSunbathMap = false;
            this.isWineMap = false;
            this.isTreasureHunt = false;
            this.isSixBossMap = false;
            return;
        }// end function

        public function isForceTypeShowMap() : Boolean
        {
            if (this.isBattlefield || this.isEscortCopy || this.isDefenseMap || this.isGuildWar || this.isArenaCopy || this.isHeroArenaMap || this.isTreasureHunt || CopyUtil.isInAllEscortTask || CopyUtil.isInZZXYBattleCopy || CopyUtil.isInGuildDefenseCopy || CopyUtil.isInMainCityBattleFinalCopy || CopyUtil.isInMainCityBattleKOCopy)
            {
                return true;
            }
            return false;
        }// end function

    }
}
